package com.lzh.others.basejava.javadoc;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * @Classname TestGenerateJavaDoc
 * @Description 测试生成JavaDoc文档
 * @Date 2021/9/2 10:33
 * @Created by liuzihao
 */
public class TestGenerateJavaDoc {
    private Integer id;
    private String message;
    /**
     * 发送消息的方法
     * @param id 接收信息人唯一标识
     * @param fileName 文件名称
     * @return sendOK 返回是否发送成功
     * @throws FileNotFoundException 可能出出现文件不存在异常
     */
    public Boolean sendMessage(Integer id, String fileName) throws FileNotFoundException {
        Boolean sendOk = false;
        FileInputStream inputStream = new FileInputStream(fileName);
        String message = inputStream.toString();
        if (message != null) {
            System.out.println("I will send message to" + id + "and the message content is" + message);
            sendOk = true;
        }
        return sendOk;
    }
}
